package cn.zhage.aimin.satoken.user;

import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpLogic;

/**
 * @author 武天奇
 * @version 1.0
 */
public class UserStpUtil {

    public static StpLogic stpLogic = new StpLogic("USER");

    public static final String PC = "PC";
    public static final String MINI = "MINI";

    //小程序登录
    public static void Minilogin(String key) {
        SaLoginModel config = new SaLoginModel();
        config.setIsWriteHeader(false);
        config.setDevice(MINI);
        stpLogic.login(key, config);
    }

    public static void PClogin(String key) {
        SaLoginModel config = new SaLoginModel();
        config.setIsWriteHeader(false);
        config.setDevice(PC);
        stpLogic.login(key, config);
    }
}
